﻿// <copyright file="Continuation.cs" company="Joe Chung">
// Copyright © 2008 by Joe Chung.
// </copyright>
namespace NScheme
{
    using System;

    public class Continuation : NScheme.Procedure
    {
        public Exception cc = null;

        public object value = null;

        public Continuation(Exception cc)
        {
            this.cc = cc;
        }

        public override object apply(Scheme interpreter, object args)
        {
            value = first(args);
            throw cc;
        }
    }
}